package springboot.com.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import springboot.com.dao.DemoDao;
import springboot.com.entity.Demo;
import springboot.com.service.DemoService;

@Service
public class DemoServiceimpl implements DemoService {
	
	 @Resource
	 private DemoDao demoDao;
	   
	 @Transactional
	 public void save(Demo demo){
		 demoDao.save(demo);
	 }


	@Override
	public Demo findById(Long id) {
		Demo demo = demoDao.findById(id);
		return demo;
	}

}
